package fr.upstlse.glre.client.vo.user;

import com.extjs.gxt.ui.client.widget.Html;



public class EtudiantVOGWT extends UserVOGWT {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3129673658098642621L;
	private String nom;
	private String prenom;
	private String email;
    private String telephonefixe;
    private String telephoneportable;
    private AdresseVOGWT adresse;
    private StageVOGWT stage;
    
	
	
	public EtudiantVOGWT() {
		super();
		nom = null;
		prenom = null;
		email = null;
	    telephonefixe = null;
	    telephoneportable = null;
	    adresse = null;
	}

	
	public EtudiantVOGWT(String nom, String prenom, String email,
			String telephonefixe, String telephoneportable, AdresseVOGWT adresse, long id, String login, String password, String role) {
		super(id, login, password, role);
		this.nom = nom;
		this.prenom = prenom;
		this.email = email;
		this.telephonefixe = telephonefixe;
		this.telephoneportable = telephoneportable;
		this.adresse = adresse;
	}
	
	public EtudiantVOGWT(String nom, String prenom, String email,
			String telephonefixe, String telephoneportable, AdresseVOGWT adresse, StageVOGWT stage, long id, String login, String password, String role) {
		super(id, login, password, role);
		this.nom = nom;
		this.prenom = prenom;
		this.email = email;
		this.telephonefixe = telephonefixe;
		this.telephoneportable = telephoneportable;
		this.adresse = adresse;
		this.stage = stage;
	}


	public String getNom() {
		return nom;
	}
	public void setNom(String nom) {
		this.nom = nom;
	}
	public String getPrenom() {
		return prenom;
	}
	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}


	public String getTelephonefixe() {
		return telephonefixe;
	}


	public void setTelephonefixe(String telephonefixe) {
		this.telephonefixe = telephonefixe;
	}


	public String getTelephoneportable() {
		return telephoneportable;
	}


	public void setTelephoneportable(String telephoneportable) {
		this.telephoneportable = telephoneportable;
	}


	public AdresseVOGWT getAdresse() {
		return adresse;
	}


	public void setAdresse(AdresseVOGWT adresse) {
		this.adresse = adresse;
	}

	public StageVOGWT getStage() {
		return stage;
	}


	public void setStage(StageVOGWT stage) {
		this.stage = stage;
	}


	public Html getHtml() {
		String lNomPrenom = "<p>" + getNom() + " "
				+ getPrenom() + "</p>";
		String lEmail = "<p>" + getEmail() + "</p>";
		
		String lTelephoneDebut = "<div class='telephoneBlock'>";
		String lTelephoneFin = "</div>";
		String lTelephoneTitre = "<div class='titre'>Téléphone</div>";
		String lTelephoneFixe = "<p>Fixe: " + getTelephonefixe() + "</p>";
		String lTelephonePortable = "<p>Portable: " + getTelephoneportable() + "</p>";
		String lTelephone = lTelephoneDebut + lTelephoneTitre +  lTelephoneFixe + lTelephonePortable + lTelephoneFin;
		
		String lAdresseDebut = "<div class='adresseBlock'>";
		String lAdresseFin = "</div>";
		String lAdresseTitre = "<div class='titre'>Adresse</div>";
		String lAdresse = lAdresseDebut + lAdresseTitre + getAdresse().getHtml().getHtml() + lAdresseFin;
		
		String lEtudiant = lNomPrenom + lEmail + lTelephone + lAdresse;
		
		Html lHTML = new Html();
		lHTML.setHtml(lEtudiant);

		return lHTML;
	}
	
	public String toString() {
		String res = "";
		res += getLogin() + "\n";
		res += getPassword() + "\n";
		res += getNom() + "\n";
		res += getPrenom() + "\n";
		res += getEmail() + "\n";
		res += getTelephonefixe() + "\n";
		res += getTelephoneportable() + "\n";
		res += getAdresse().getVoie() + "\n";
		res += getAdresse().getCodepostal() + "\n";
		res += getAdresse().getVille() + "\n";
		res += getAdresse().getPays() + "\n";
		return res;
	}
	
}
